﻿je_peru_bolivia_lai = { 
	icon = "gfx/interface/icons/event_icons/event_centralization.dds"

	on_monthly_pulse = {
		effect = {
			change_variable = {
				name = peru_bolivia_var
				add = 1
			}
		}
	}

	complete = {
		scope:journal_entry = { is_goal_complete = yes }
	}

	on_complete = {
		trigger_event = {
			id = peru_bolivia_confederation.8
		}
	}

	fail = {
		OR = {
			NOT = { exists = c:ESP }
			c:ESP = {
				NOT = { is_subject_of = ROOT }
			}
			
			NOT = { exists = c:PEU }
			c:PEU = {
				NOT = { is_subject_of = ROOT }
			}
		}		
	}

	current_value = {
		value = root.var:peru_bolivia_var
	}

	goal_add_value = {
		value = 120
	}

	progressbar = yes

	weight = 10000

	should_be_pinned_by_default = yes
}

je_peru_bolivia_the_feeble_union = { 
	icon = "gfx/interface/icons/event_icons/event_fire.dds"

	immediate = {
		c:PEU = {
			save_scope_as = peu_scope
		}
	}

	on_monthly_pulse = {
		effect = {
			if = {
				limit = {
					is_at_war = no
					c:PEU = {
						relations:root < relations_threshold:cordial
					}
				}
				change_variable = {
					name = peru_the_feeble_union_var
					add = 1
				}
			}
		}
	}

	is_shown_when_inactive = {
		exists = c:BOL
        THIS = c:BOL
		c:PEU = {
			is_subject_type = subject_type_confederation
			is_subject_of = c:BOL
		}
	}

	possible = {
		c:PEU ?= {
			relations:root < relations_threshold:cordial
		}
	}

	complete = {
		scope:journal_entry = { is_goal_complete = yes }
		c:PEU = {
			is_at_war = no
		}
	}

	on_complete = {
		c:PEU = {
			trigger_event = {
				id = journal_flavor_peru.1
		    }
		}
	}

	fail = {
		NOT = {
			c:PEU = {
				is_subject_of = c:BOL
			}
		}
	}

	current_value = {
		value = root.var:peru_the_feeble_union_var
	}

	goal_add_value = {
		value = 20
	}

	progressbar = yes

	weight = 10000

	should_be_pinned_by_default = yes
}

je_peru_restoration = { 
	icon = "gfx/interface/icons/event_icons/event_scales.dds"

	is_shown_when_inactive = {
		exists = c:PEU
		exists = c:ESP
        THIS = c:PEU
	}

	possible = {
		is_subject_type = subject_type_confederation
	}

	complete = {
		is_subject = no 
		OR = {
			c:ESP = { is_subject = no }	
		}
	}

	on_complete = {
            annex = c:ESP
	}

	fail = {
		OR = {
			NOT = { exists = c:ESP }
		}
	}

	goal_add_value = {
		value = 120
	}

	weight = 10000

	should_be_pinned_by_default = yes
}